using System.Collections.Generic;
using System.Data;
using System.Net.Sockets;
using System.Windows.Data;
using WPFExcelReport.Helpers;
namespace WPFExcelReport
{
    public partial class VAMSTAMM
    {

        public void CHKZLAM(string ip)
        {
            if (ip.Length < 3)
                return;
            dwData = TBMain.NewRow();
            dwData["AMMANDANT"] = app.Mandant;
            dwData["AMHERST"] = ip.PadRight(20);
            SResult = QAM06(dwData);
            MergeData(SResult, false);
            if (SResult.Tables[0].Rows.Count > 0)
                return;
            dwData = TBMain.NewRow();
            SetUpNewRow(ref dwData);
            dwData["AMMANDANT"] = app.Mandant;
            dwData["AMHERST"] = ip.PadRight(20);
            dwData["AMART"] = "ZLAN".PadRight(8);
            dwData["AMNRKRS"] = "ZL";
            string[] lfd = ip.Split('.');
            dwData["AMLFDNR"] = Helper.Right("0000" + lfd[3], 4);
            dwData["AMPOS"] = "00";
            SResult = QAM08(dwData);
            TBMain.Rows.InsertAt(dwData, 0);
            if (SResult.Tables[0].Rows.Count > 0)
                return;
            InserAMSTAMM(dwData);
        }
    }    
}
